import { defaultRequest as rq } from "./request";
import type { R } from "./request";
import type { AsideMenu } from '@/assets/constants/menu'

export const menuListApi = (data?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${BSMS_URL}/menu/list", data);
};

export const menuTreeApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${BSMS_URL}/menu/tree", { params });
};

export const checkApi = (params?: object): Promise<R<any>> => {
  return rq.get<R<any>>("${BSMS_URL}/token/check", { params });
};

// rbac
export const menuTreeByAuthUserApi = (params?: object): Promise<R<AsideMenu>> => {
  return rq.get<AsideMenu>("${BSMS_URL}/rbac/menutree/by/authuser", { params });
};